/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.prod.wip.dao.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name="prod_wip_task_procedure", schema="erp")
@DynamicInsert(true)
@DynamicUpdate(true)
public class ProdWipTaskProcedure implements java.io.Serializable {

    //serialVersionUID
    private static final long serialVersionUID = 1L;

    //Constructors
    public ProdWipTaskProcedure() {
    }
    
    //Fields
    
    //主键
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "task_procedure_id", unique = true, nullable = false)
    private Integer taskProcedureId;
    
    public Integer getTaskProcedureId() {
        return this.taskProcedureId;
    }
    public void setTaskProcedureId(Integer taskProcedureId) {
        this.taskProcedureId = taskProcedureId;
    }
    
    //任务工序行编码
    @Column(name = "task_procedure_code", unique = true, nullable = false, length = 45)
    private String taskProcedureCode;
    
    public String getTaskProcedureCode() {
        return this.taskProcedureCode;
    }
    public void setTaskProcedureCode(String taskProcedureCode) {
        this.taskProcedureCode = taskProcedureCode;
    }
    
    //任务编码
    @NotBlank(message="任务编码不能为空")
    @Column(name = "task_code", unique = false, nullable = false, length = 45)
    private String taskCode;
    
    public String getTaskCode() {
        return this.taskCode;
    }
    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }
    
    //工序编码
    @NotBlank(message="工序编码不能为空")
    @Column(name = "procedure_code", unique = false, nullable = false, length = 45)
    private String procedureCode;
    
    public String getProcedureCode() {
        return this.procedureCode;
    }
    public void setProcedureCode(String procedureCode) {
        this.procedureCode = procedureCode;
    }
    
    //转移工序编码
    @Column(name = "shift_procedure_code", unique = false, nullable = true, length = 45)
    private String shiftProcedureCode;
    
    public String getShiftProcedureCode() {
        return shiftProcedureCode;
    }
    public void setShiftProcedureCode(String shiftProcedureCode) {
        this.shiftProcedureCode = shiftProcedureCode;
    }

    //工作中心
    @NotBlank(message="工作中心不能为空")
    @Column(name = "work_center_code", unique = false, nullable = false, length = 45)
    private String workCenterCode;
    
    public String getWorkCenterCode() {
        return this.workCenterCode;
    }
    public void setWorkCenterCode(String workCenterCode) {
        this.workCenterCode = workCenterCode;
    }
    
    //前置期
    @Column(name = "produce_pre_days", unique = false, nullable = false)
    private Double producePreDays;
    
    public Double getProducePreDays() {
        return this.producePreDays;
    }
    public void setProducePreDays(Double producePreDays) {
        this.producePreDays = producePreDays;
    }
    
    //工时
    @Column(name = "finish_days", unique = false, nullable = true)
    private Double finishDays;
    
    public Double getFinishDays() {
        return this.finishDays;
    }
    public void setFinishDays(Double finishDays) {
        this.finishDays = finishDays;
    }
    
    //完成数量
    @Column(name = "finish_quantity", unique = false, nullable = true)
    private Double finishQuantity;
    
    public Double getFinishQuantity() {
        return this.finishQuantity;
    }
    public void setFinishQuantity(Double finishQuantity) {
        this.finishQuantity = finishQuantity;
    }
    
    //成本费率
    @Column(name = "cost_amount", unique = false, nullable = false)
    private Double costAmount;
    
    public Double getCostAmount() {
        return this.costAmount;
    }
    public void setCostAmount(Double costAmount) {
        this.costAmount = costAmount;
    }
    
    //开工日期
    @Column(name = "start_date", unique = false, nullable = true)
    private Date startDate;
    
    public Date getStartDate() {
        return this.startDate;
    }
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }
    
    //完工日期
    @Column(name = "end_date", unique = false, nullable = true)
    private Date endDate;
    
    public Date getEndDate() {
        return this.endDate;
    }
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }
    
    //摘要
    @Column(name = "memo", unique = false, nullable = true, length = 500)
    private String memo;
    
    public String getMemo() {
        return this.memo;
    }
    public void setMemo(String memo) {
        this.memo = memo;
    }
    
    //版本
    @Column(name = "version", unique = false, nullable = false)
    private Integer version;
    
    public Integer getVersion() {
        return this.version;
    }
    public void setVersion(Integer version) {
        this.version = version;
    }
    
    //状态（等待WAIT、加工WORK、转移SHIFT）
    @NotBlank(message="工序状态不能为空")
    @Column(name = "status", unique = false, nullable = false, length = 45)
    private String status;
    
    public String getStatus() {
        return this.status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    
    //创建时间
    @Column(name = "created_date", unique = false, nullable = false)
    private Date createdDate;
    
    public Date getCreatedDate() {
        return this.createdDate;
    }
    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }
    
    //创建人
    @Column(name = "created_by", unique = false, nullable = false, length = 45)
    private String createdBy;
    
    public String getCreatedBy() {
        return this.createdBy;
    }
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }
    
    //最后修改时间
    @Column(name = "last_updated_date", unique = false, nullable = true)
    private Date lastUpdatedDate;
    
    public Date getLastUpdatedDate() {
        return this.lastUpdatedDate;
    }
    public void setLastUpdatedDate(Date lastUpdatedDate) {
        this.lastUpdatedDate = lastUpdatedDate;
    }
    
    //最后修改人
    @Column(name = "last_updated_by", unique = false, nullable = true, length = 45)
    private String lastUpdatedBy;
    
    public String getLastUpdatedBy() {
        return this.lastUpdatedBy;
    }
    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }
    
    //组织机构
    @Column(name = "org_code", unique = false, nullable = false, length = 10)
    private String orgCode;
    
    public String getOrgCode() {
        return this.orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    
    
    
    //显示字段
    @Transient
    private String workCenterName;
    @Transient
    private String procedureName;
    @Transient
    private String shiftProcedureName;
    @Transient
    private String procedureShiftType;

    public String getWorkCenterName() {
        return workCenterName;
    }
    public void setWorkCenterName(String workCenterName) {
        this.workCenterName = workCenterName;
    }
    public String getProcedureName() {
        return procedureName;
    }
    public void setProcedureName(String procedureName) {
        this.procedureName = procedureName;
    }
    public String getShiftProcedureName() {
        return shiftProcedureName;
    }
    public void setShiftProcedureName(String shiftProcedureName) {
        this.shiftProcedureName = shiftProcedureName;
    }
    public String getProcedureShiftType() {
        return procedureShiftType;
    }
    public void setProcedureShiftType(String procedureShiftType) {
        this.procedureShiftType = procedureShiftType;
    }
    
}